<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>学生端</title>
		<link rel="stylesheet" href="../css/layui.css">
		<script type="text/javascript" src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/jquery.min.js"></script>
	</head>

	<body class="layui-layout-body">
		<div class="layui-layout layui-layout-admin" id="app">
			<div class="layui-header layui-bg-cyan">
				<div class="layui-logo " style="font-size: 22px;color: #CAE1FF;">实验管理系统</div>

				<!-- 头部区域（可配合layui已有的水平导航）
				<ul class="layui-nav layui-layout-left  ">
					<li class="layui-nav-item">
						<a href="">控制台</a>
					</li>
					<li class="layui-nav-item">
						<a href="">商品管理</a>
					</li>
					<li class="layui-nav-item">
						<a href="">用户</a>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;">其它系统</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="">邮件管理</a>
							</dd>
							<dd>
								<a href="">消息管理</a>
							</dd>
							<dd>
								<a href="">授权管理</a>
							</dd>
						</dl>
					</li>
				</ul>
				 -->

				<ul class="layui-nav layui-layout-right ">
					<li class="layui-nav-item">
						<a href="javascript:;">
							{{stu.stuName}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" target="main" @click="jumpchangepwd">修改密码</a>
							</dd>
							<dd>
								<a href="" @click="stuQuit()">安全退出</a>
							</dd>
						</dl>
					</li>

				</ul>

			</div>

			<div class="layui-side layui-bg-cyan ">

				<div class="layui-side-scroll">
					<!-- 左侧导航区域（可配合layui已有的垂直导航） -->

					<ul class="layui-nav layui-nav-tree layui-bg-cyan" lay-filter="test">
						<li class="layui-nav-item layui-nav-itemed">
							<a href="javascript:;" target="main" @click="jumpnotify">通知</a>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;" target="main" @click="jumprepara">预习资料</a>

						</li>
						<li class="layui-nav-item ">
							<a class="" href="javascript:;">进入实验</a>
							<dl class="layui-nav-child">
								<dd>
									<a href="javascript:;" target="main" @click="jumplookcon">查看内容</a>
								</dd>

								<!--<dd>
									<a href="uploadfile.html" target="main">报告上传</a>
								</dd>-->

							</dl>
						</li>

						<li class="layui-nav-item" id="redp" @click="handleclick">
							<a href="javascript:;" target="main" @click="jumpwarn">异常信息<span class="layui-badge-dot layui-bg-red" v-if="point"></a>
						</li>
					</ul>
				</div>
			</div>

			<div class="layui-body">
				<!-- 内容主体区域 -->

				<iframe src="notify.html" name="main" width="100%" height="99%" frameborder="0">
 您的浏览器不支持iframe，请升级
 </iframe>

			
			</div>

			<div class="layui-footer">
				<!-- 底部固定区域 -->
			<div class="layui-col-lg-offset4">©  - 燕山大学软件工程专业实验管理系统</div>
			</div>
		</div>
		<script src="../layui.js"></script>
		
		<script type="text/javascript" src="../js/jquery.min.js" ></script>
		<script type="text/javascript" src="../js/jquery.cookie.js" ></script>
		<script type="text/javascript" src="../js/vue.min.js" ></script>
		<script>
			$(function() {
				
				$(document).bind("contextmenu", function(e) {
					return false;
				});

				
				$.ajax({
					type: "get",
					url: "http://localhost:8080/student/nodo.do",
					async: false,
					dataType: "json",
					data: {
						sid: $.cookie("sid")
					},
					success: function(data) {
						if(data.info == '404') {
							window.location.href = "../student/stulogin.html";
						}
					}
				});
				
				var point;
				$.ajax({
					type: "get",
					dataType: "json",
					url: "http://127.0.0.1:8080/student/warn/warnpoint.do",
					async: false,
					data: {
						sid: $.cookie("sid")
					},
					success: function(data) {
						point = data;
					}
				});
				
				var stu;
				$.ajax({
					type:"get",
					url:"http://localhost:8080/student/getStudent.do",
					async:false,
					dataType:"json",
					data:{
						sid:$.cookie("sid")
					},
					success:function(data){
						stu = data;
						console.log(stu);
					}
				});
		
				var vue = new Vue({
					el: "#app",
					data: {
						point: point,
						stu:stu
					},
					methods: {
						handleclick: function() {
							if(point) {
								this.point = false;
							}
						},
						stuQuit:function(){
							//alert("退出");
							//http://localhost:8080/student/updatePwd.do
							$.ajax({
								type:"get",
								url:"http://localhost:8080/student/stuQuit.do",
								async:false,
								dataType:"json",
								data:{
									sid:$.cookie("sid")
								},
								success:function(data){
									//alert(data);
								}
								
							});
						},
						jumpnotify:function(){
							
							window.parent.main.location.href="notify.html";
							
						},
						jumprepara:function(){
							window.parent.main.location.href="prepara.html";
						},
						jumplookcon:function(){
							window.parent.main.location.href="lookcon.html";
						},
						jumpwarn:function(){
							window.parent.main.location.href="warn.html";
						},
						jumpchangepwd:function(){
							window.parent.main.location.href="changepwd.html";
						}
			
					}
			
				});//vue
			
				
			});
		
			$("#workout").click(function() {
				window.location.href = "../teacher/backindex.html";
		
			});
			//JavaScript代码区域
			layui.use('element', function() {
				var element = layui.element;
		
			});
		

		</script>
	</body>

</html>